<?php
/*
|------------------------------------------------------------------|
|	Level5 - Wordpress Theme Framework
|
|	Copyright (c) Brixter de Leon
|	http://frostproject.org
|	deleon.brixter@gmail.com
|
|	This program is free software; you can redistribute it and/or
|	modify it under the terms of the GNU General Public License
|	as published by the Free Software Foundation; either version 2
|	of the License, or (at your option) any later version.
|
|	This program is distributed in the hope that it will be useful,
|	but WITHOUT ANY WARRANTY; without even the implied warranty of
|	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
|	GNU General Public License for more details.
|
|	You should have received a copy of the GNU General Public License
|	along with this program; if not, write to the Free Software
|	Foundation, Inc., 51 Franklin Street, Fifth Floor, 
|	Boston, MA  02110-1301, USA.
|------------------------------------------------------------------|
*/

if ( ! defined( 'direct_access' ) ) { die( 'Level5' ); }

/**
 * Theme option attributes.
 *
 * @note Do not edit this file.
 * @param string $type
 * @return settings
 */
function level5_attributes( $type )
{
	global $settings, $value, $level5_theme_info;
	switch ( $type )
	{
		case 'general' :
			// Determine if the page is general or theme option
			if ( file_exists( level5_child . level5_template . '/loader.php' ) )
			{
				$check_update = __( 'Changes has been saved. <a href="admin.php?page=' . level5_sanitize( level5_page2 ) . '">Theme options.</a>', 'level5' );
			}
			else
			{
				$check_update = __( 'Changes has been saved. <a href="' . site_url() . '">Click here to preview your website.</a>', 'level5' );
			}
			$settings = array
			(
				array
				(
					'type' => 'status',
					'update' => $check_update,
				),
				array
				(
					'type' => 'start_form',
				),
				array
				(
					'type' => 'h3',
					'value' => __( 'Default options', 'level5' ),
				),
				array
				(
					'type' => 'start_table'
				),
				array
				(
					'type' => 'select',
					'tr_class' => 'row-1',
					'title' => __( 'HTML doctype', 'level5' ),
					'desc' => __( 'Choose doctype <sup>[<a href="http://en.wikipedia.org/wiki/Document_Type_Declaration" class="external" target="_blank">wikipedia</a>]</sup> that is suitable for your theme.', 'level5' ),
					'value' => array
					(
						'HTML5',
						'HTML 4.01 Strict',
						'HTML 4.01 Transitional',
						'HTML 4.01 Frameset',
						'XHTML 1.0 Strict',
						'XHTML 1.0 Transitional',
						'XHTML 1.0 Frameset',
						'XHTML 1.1'
					),
					'id' => level5_frameprefix . 'doctype',
					'default' => level5_doctype
				),
				array
				(
					'type' => 'radio',
					'tr_class' => 'row-2',
					'title' => __( 'Blog title', 'level5' ),
					'value' => array
					(
						'Title | Description',
						'Description | Title',
						'Title - Description',
						'Description - Title',
						'Title',
						'Description',
						'Page | Title - Description',
						'Page | Description - Title'
					),
					'id' => level5_frameprefix . 'blog_title',
					'default' => level5_blog_title
				),
				array
				(
					'type' => 'input',
					'tr_class' => 'row-1',
					'class' => 'large',
					'title' => __( 'Copyright notice', 'level5' ),
					'desc' => __( 'Add your own copyright notice to the footer.', 'level5' ),
					'id' => level5_frameprefix . 'copyright',
					'value' => level5_copyright
				),
				array
				(
					'type' => 'textarea',
					'tr_class' => 'row-2',
					'title' => __( 'Sponsor notice', 'level5' ),
					'desc' => __( 'You are free to remove this message.', 'level5' ),
					'rows' => 7, // Specifies the visible number of lines in a text area
					'cols' => 70, // Specifies the visible width of a text area
					'id' => level5_frameprefix . 'powerby',
					'value' => level5_powerby
				),
				array
				(
					'type' => 'end_table'
				),
				array
				(
					'type' => 'submit',
					'class' => 'submit-button',
					'value' => __( 'Save changes', 'level5' )
				),
				array
				(
					'type' => 'end_form'
				),
			);
		break;
		case 'about' :
			$settings = array
			(
				array
				(
					'type' => 'about'
				)
			);
		break;
		case 'upload' :
			$settings = array
			(
				array
				(
					'type' => 'status',
					'update' => __( 'Theme uploaded. Go to <sup>[Level5 &rsaquo; General]</sup> to select the theme.', 'level5' ),
				),
				array
				(
					'type' => 'start_form',
				),
				array
				(
					'type' => 'h3',
					'value' => __( 'Install ' . level5_framename . ' themes', 'level5' ),
				),
				array
				(
					'type' => 'start_table'
				),
				array
				(
					'type' => 'upload',
					'tr_class' => 'row-1',
					'title' => __( 'Upload a theme from your local machine', 'level5' ),
					'desc' => __( 'Allowed file extension are: <sup>[.zip and .level5]</sup>.<br /><br />Theme directory name must have no spaces.', 'level5' ),
					'id' => level5_frameprefix . 'template',
					'default' => level5_template
				),
				array
				(
					'type' => 'end_table'
				),
				array
				(
					'type' => 'submit',
					'class' => 'submit-button',
					'value' => __( 'Upload', 'level5' )
				),
				array
				(
					'type' => 'end_form'
				),
			);
		break;
		case 'themes' :
			if ( $_REQUEST['action'] == 'activate' )
			{
				// Determine if the page is general or theme option
				if ( file_exists( level5_child . level5_template . '/loader.php' ) )
				{
					$check_update = __( 'Theme activated. <a href="admin.php?page=' . level5_sanitize( level5_page2 ) . '">This theme supports theme options.</a>', 'level5' );
				}
				else
				{
					$check_update = __( 'Theme activated.', 'level5' );
				}
			}
			else
			{
				$check_update = __( 'Theme deleted.', 'level5' );
			}
			$settings = array
			(
				array
				(
					'type' => 'status',
					'update' => $check_update,
				),
				array
				(
					'type' => 'h3',
					'value' => __( 'Current theme: ' . $level5_theme_info['name'], 'level5' )
				),
				array
				(
					'type' => 'theme_current'
				),
				array
				(
					'type' => 'separator'
				),
				array
				(
					'type' => 'h3',
					'value' => __( 'Available themes', 'level5' )
				),
				array
				(
					'type' => 'themes_list'
				),
				array
				(
					'type' => 'submit',
					'class' => 'submit-button',
					'value' => ''
				),
			);
		break;
		// Fetch the child theme's option.
		case 'child' :
			// Check if options.php exist in a theme. If it exist, add a page for theme options.
			if ( file_exists( level5_child . level5_template . '/options.php' ) )
			{
				include( level5_child . level5_template . '/options.php' );
			}
		break;
	}
}
?>